package com.xzx.flink.streamapi.source;

import com.xzx.flink.bean.ClickEvent;
import org.apache.flink.streaming.api.datastream.DataStreamSource;
import org.apache.flink.streaming.api.environment.StreamExecutionEnvironment;

/**
 * 自定义并行source
 *
 * @author xinzhixuan
 * @version 1.0
 * @date 2021-08-24 10:59 下午
 */
public class SourceFromCustomParallelSource {
    public static void main(String[] args) throws Exception {
        StreamExecutionEnvironment env = StreamExecutionEnvironment.getExecutionEnvironment();
        env.setParallelism(2);
        DataStreamSource<ClickEvent> dataStream = env.addSource(new ClickSource());

        dataStream.print("tt");

        env.execute(SourceFromCustomParallelSource.class.getName());
    }

}

